/**
 * Created by jack on 2016-12-29.
 */
new Vue({

el:'.login-content',
    data:{
        title:'tencent-erp',
        author:'jack',
        user:{username:'',password:''},
        item:{
            0:{title:'测试数据展示',url:''},
            1:{title:'测试数据展示',url:''},
            2:{title:'测试数据展示',url:''},
            3:{title:'测试数据展示',url:''}
        }
    },
    methods:{

       submit:function(){
           if(this.user.username=="")
           {

              alert('用户名不能为空');

           }else if(this.user.username==""){

               alert('密码不能为空');


           }else{
               $.post('/login',this.user,function(res){


                  alert(res.message);
                   location.href=res.url;

               },'json');
           }
       }
    }
})